package com.zyz.D_方法.练习;

/**
 * @author: vick
 * @Date: 2025/3/13
 * @Description:
 * @version: 1.0
 */
public class Demo1 {
    public static void main(String[] args) {
        Demo1 demo1 = new Demo1();
        int[] nums = {10, 20, 30, 40, 50};
        double ave = demo1.ave(nums);
        System.out.println(ave);
    }

    public double ave(int[] nums) {
        int sum = 0;
        for (int num : nums) {
            sum += num;
        }
        return (double) sum/nums.length;
    }
}
